home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmFlowchar
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Example 4: FlowChart"
- ClientHeight = 3990
- ClientLeft = 1050
- ClientTop = 1680
- ClientWidth = 5790
- DrawStyle = 5 'Transparent
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000C0&
- Height = 4395
- Left = 990
- LinkTopic = "Form4"
- MDIChild = -1 'True
- ScaleHeight = 3990
- ScaleWidth = 5790
- Tag = "4"
- Top = 1335
- Width = 5910
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 930
- Index = 3
- Left = 4770
- Picture = "Flowchar.frx":0000
- ScaleHeight = 900
- ScaleWidth = 900
- TabIndex = 3
- Top = 2940
- Visible = 0 'False
- Width = 930
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 930
- Index = 2
- Left = 4770
- Picture = "Flowchar.frx":0802
- ScaleHeight = 900
- ScaleWidth = 900
- TabIndex = 2
- Top = 1980
- Visible = 0 'False
- Width = 930
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 930
- Index = 1
- Left = 4770
- Picture = "Flowchar.frx":1004
- ScaleHeight = 900
- ScaleWidth = 900
- TabIndex = 1
- Top = 1020
- Visible = 0 'False
- Width = 930
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 930
- Index = 0
- Left = 4770
- Picture = "Flowchar.frx":1806
- ScaleHeight = 900
- ScaleWidth = 900
- TabIndex = 0
- Top = 60
- Visible = 0 'False
- Width = 930
- End
- Begin AddFlowLib.AddFlow AddFlow1
- Height = 3495
- Left = 270
- TabIndex = 4
- Top = 240
- Width = 3825
- _Version = 65536
- _ExtentX = 6747
- _ExtentY = 6165
- _StockProps = 101
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BorderStyle = 1
- ScrollBars = 3
- Shape = 0
- LinkStyle = 0
- Alignment = 7
- AutoSize = 0
- ArrowDst = 3
- ArrowOrg = 0
- DrawStyle = 0
- DrawWidth = 1,4013e-45
- ReadOnly = 0 'False
- MultiSel = -1 'True
- CanDrawNode = -1 'True
- CanDrawLink = -1 'True
- CanMoveNode = -1 'True
- CanSizeNode = -1 'True
- CanStretchLink = -1 'True
- CanMultiLink = -1 'True
- Transparent = 0 'False
- ShowGrid = 0 'False
- Hidden = 0 'False
- Rigid = 0 'False
- DisplayHandles = -1 'True
- AutoScroll = -1 'True
- xGrid = 7,00649e-45
- yGrid = 7,00649e-45
- xZoom = 100
- yZoom = 100
- FillColor = 16777215
- DrawColor = 0
- ForeColor = 0
- BackPicture = "Flowchar.frx":2008
- End
- Attribute VB_Name = "frmFlowchar"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Sub CursorShape(AddFlow1 As Control)
- With AddFlow1
- Dim area%
- area = .PointedArea
- Select Case area
- Case 0
- .MousePointer = 8
- Case 1
- .MousePointer = 7
- Case 2
- .MousePointer = 6
- Case 3
- .MousePointer = 9
- Case 7
- If .SelectMode = True Then
- .MousePointer = 2
- Else
- .MousePointer = 0
- End If
- End Select
- End With
- End Sub
- Private Sub AddFlow1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Me.SetFocus
- End Sub
- Private Sub Form_Activate()
- frmMain.ActivateForm
- End Sub
- Private Sub Form_Deactivate()
- frmMain.DeactivateForm
- End Sub
- Private Sub Form_Load()
- frmMain.ShowExample(3).Enabled = False
- Dim nodx As afNode, lnkx As afLink
- Dim pt As New afLinkPoint
- With AddFlow1
- .Left = 0
- .Top = 0
- ' Just to accelerate display (Don't forget to reset it at the end)
- .Repaint = False
- ' Default settings
- .AutoSize = afAdjustNodeSizetoPicture
- .Shape = afRectangle
- .LinkStyle = afBezier
- ' Create nodxs
- Set nodx = .Nodes.Add(200, 200, 800, 800)
- nodx.Shape = afRoundRect
- nodx.Text = "BEGIN"
- Set nodx.Picture = Picture1(1).Picture
- Set nodx = .Nodes.Add(200, 2200, 800, 800)
- nodx.Text = "STEP1"
- Set nodx.Picture = Picture1(0).Picture
- Set nodx = .Nodes.Add(2200, 2200, 800, 800)
- nodx.Shape = afDiamond
- nodx.Text = "Success?"
- Set nodx.Picture = Picture1(2).Picture
- Set nodx = .Nodes.Add(4200, 1000, 800, 800)
- nodx.Text = "STEP3"
- Set nodx.Picture = Picture1(0).Picture
- Set nodx = .Nodes.Add(6200, 2200, 800, 800)
- nodx.Shape = afRoundRect
- nodx.Text = "END"
- Set nodx.Picture = Picture1(1).Picture
- Set nodx = .Nodes.Add(4200, 3400, 800, 800)
- nodx.Shape = afEllipse
- nodx.Text = "STEP2"
- Set nodx.Picture = Picture1(3).Picture
- .DrawStyle = 0
- .ArrowDst = afEmptyArrow30
- .ForeColor = RGB(0, 0, 255)
- .DrawColor = RGB(0, 0, 255)
- ' Create lnkxs
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(3))
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(4))
- pt.X = 2440
- pt.Y = 1840
- lnkx.ExtraPoints.Add pt
- pt.X = 2840
- pt.Y = 1440
- lnkx.ExtraPoints.Add pt
- lnkx.Text = "YES"
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(6))
- pt.X = 2640
- pt.Y = 3840
- lnkx.ExtraPoints.Add pt
- lnkx.Text = "NO"
- Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(5))
- Set lnkx = .Nodes(6).OutLinks.Add(.Nodes(5))
- .Repaint = True
- End With
- End Sub
- Private Sub Form_Resize()
- If WindowState <> 1 And ScaleHeight <> 0 Then
- AddFlow1.Height = ScaleHeight
- AddFlow1.Width = ScaleWidth
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- frmMain.ShowExample(3).Enabled = True
- End Sub
- Private Sub AddFlow1_KeyDown(KeyCode As Integer, Shift As Integer)
- Const KEY_DELETE = &H2E
- If KeyCode = KEY_DELETE Then
- AddFlow1.DeleteSel
- End If
- End Sub
- Private Sub AddFlow1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- CursorShape AddFlow1
- End Sub
-